﻿using System;
using System.Linq.Expressions;

namespace easyccms.BusinessLayer.Entities
{
  /// <summary>
  /// Abstract class to be extended by domain objects.
  /// </summary>
  public abstract class Entity
  {
  }

  /// <summary>
  /// Domain object extensions.
  /// </summary>
  public static class DomainObjExtensions
  {
    public static bool Meets<T>(this T entity, Expression<Func<T, bool>> f) where T : Entity
    {
      Func<T, bool> myFunc = f.Compile();
      return myFunc(entity);
    }
  }
}
